<template>
  <div>
    <LazyLoadTab v-model="activeName" :tabMenus="menus" :destroyOnClose="true"></LazyLoadTab>
  </div>
</template>

<script>
export default {
  name: 'customerFollowInfo',
  data() {
    return {
      activeName: '未完成',
      menus: [
        {
          title: '未完成',
          path: 'potenCus/customer/customerFollowInfo/tabs/follow',
          params: {
            isComplete: 10041002
          }
        },
        {
          title: '已完成',
          path: 'potenCus/customer/customerFollowInfo/tabs/follow',
          params: {
            isComplete: 10041001
          }
        },
        {
          title: '全部',
          path: 'potenCus/customer/customerFollowInfo/tabs/follow',
          params: {
            isComplete: 10041003
          }
        }
      ]
    };
  },
  created() {},
  mounted() {
    switch (this.$route.query.active) {
      case 1: //首页-跟进任务 截止至今日所有未跟进任务
        // this.menus[2].params.searchData = {
        //   time: this.$route.query.time,
        //   planActionDate: [this.$route.query.time,this.$route.query.time]
        // }
        // // this.menus = JSON.parse(JSON.stringify(this.menus))
        // this.activeName = '全部'
        this.menus[0].params.searchData = {
          time: this.$route.query.time,
          planActionDate: ['2020-01-01', this.$route.query.time]
        };
        if (0 != this.$route.query.consultant) {
          this.menus[0].params.consultant = this.$route.query.consultant;
          this.menus[0].params.flag = 1;
        }
        // this.menus = JSON.parse(JSON.stringify(this.menus))
        this.activeName = '未完成';
        break;
      case 2: //首页-跟进任务 截止至今日所有未逾期未跟进任务
        this.menus[0].params.searchData = {
          time: this.$route.query.time,
          // planActionDate: [this.$route.query.time,this.$route.query.time]
          planActionDate: ['2020-01-01', this.$route.query.time],
          isOverdue: 70441002
        };
        if (0 != this.$route.query.consultant) {
          this.menus[0].params.consultant = this.$route.query.consultant;
          this.menus[0].params.flag = 1;
        }
        // this.menus = JSON.parse(JSON.stringify(this.menus))
        this.activeName = '未完成';
        break;
      case 3: //首页-跟进任务 截止至今日所有逾期未跟进任务
        this.menus[0].params.searchData = {
          // time: this.$route.query.time,
          // planActionDate: [this.$route.query.time,this.$route.query.time],
          planActionDate: ['2020-01-01', this.$route.query.time],
          isOverdue: 70441001
        };
        if (0 != this.$route.query.consultant) {
          this.menus[0].params.consultant = this.$route.query.consultant;
          this.menus[0].params.flag = 1;
        }
        this.activeName = '未完成';
        break;
      case 4:
        this.menus[0].params.searchData = {
          time: this.$route.query.time,
          planActionDate: [this.$route.query.time, this.$route.query.time]
        };
        if (0 != this.$route.query.consultant) {
          this.menus[0].params.consultant = this.$route.query.consultant;
          this.menus[0].params.flag = 1;
        }
        // this.activeName = '全部';
        this.activeName = '未完成';
        break;
      default:
        break;
    }
  }
};
</script>

<style lang="less" scoped>
</style>
